Minimum product modulo N possible for any pair from a given range
Given three integers L, R, and N, the task is to find the minimum possible value of (i * j) % N, where L ? i < j ? R....
read more
Inorder Tree Traversal in Binary Tree in C
A binary Tree is a hierarchical data structure in which each node has at most two children and it can referred to as the left child and right child. Due to being a non-linear data structure, different traversal techniques are possible for it....
read more
Difference between while and do-while loop in C, C++, Java
while loop:...
read more
modf() in C/C++
In C++, modf() is a predefined function used for mathematical calculations. math.h is the header file required for various mathematical functions. All the functions available in this library take double as an argument and return double as the result. modf() function breaks the given argument into two parts, one is integer and the other one is fractional. Integer part is stored in the memory address pointed by the pointer which is passed as second argument in the function and the fractional part is returned by the function. Syntax:...
read more
Maximize sum that can be obtained from two given arrays based on given conditions
Given two arrays A[] and B[] each of size N, the task is to find the maximum sum that can be obtained based on the following conditions:...
read more
One Dimensional Arrays in C
In C, an array is a collection of elements of the same type stored in contiguous memory locations. This organization allows efficient access to elements using their index. Arrays can also be of different types depending upon the direction/dimension they can store the elements. It can be 1D, 2D, 3D, and more. We generally use only one-dimensional, two-dimensional, and three-dimensional arrays....
read more
Why are elementwise additions much faster in separate loops than in a combined loop?
When adding more than 2 arrays, separate loops for adding elements step by step prove to give a better performance than adding the elements in a single loop....
read more
How to Create a Dynamic Array of Strings in C?
In C, dynamic arrays are essential for handling data structures whose size changes dynamically during the program’s runtime. Strings are arrays of characters terminated by the null character ‘\0’. A dynamic array of strings will ensure to change it’s size dynamically during the runtime of the program as per the user’s needs. In this article, we will learn how to create a dynamic array of strings in C....
read more
Count ways to reach the Nth stair using any step from the given array
Given N stairs and a person standing at the bottom wants to reach the top. He could climb any number of steps from the given array arr[] of positive integers. The task is to find the count of all possible ways to reach the top....
read more
IPC using Message Queues
Prerequisite : Inter Process Communication A message queue is a linked list of messages stored within the kernel and identified by a message queue identifier...
read more
Difference Between Call by Value and Call by Reference in C
Functions can be invoked in two ways: Call by Value or Call by Reference. These two ways are generally differentiated by the type of values passed to them as parameters....
read more
Header Files in C
In C language, header files contain a set of predefined standard library functions. The .h is the extension of the header files in C and we request to use a header file in our program by including it with the C preprocessing directive “#include”....
read more